package group4_project6;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;

public class project6 {
	
	
	public static void main(String[]args){
	
	
	ArrayList<String> List1 = new ArrayList<String>();
	ArrayList<String> List2 = new ArrayList<String>();
	List1.add("GREG");
	List1.add("CRAIG");
	List1.add("DAVID");
	List1.add("BEHVEAN");
	List1.add("SCOTT");
	
	
	List2.add("KIM");
	List2.add("BEN");
	List2.add("TIM");
	List2.add("SCOTT");
	List2.add("GARY");
	
	List1.addAll(List2);
	HashSet hash1 = new HashSet();
	hash1.addAll(List1);
	hash1.addAll(List2);
	Iterator it = hash1.iterator();
	//System.out.print("[");
	/*while (it.hasNext())
	{
		   String next = (String) it.next();
		   if(it.hasNext())
				   {
			          System.out.print(next+ ", ");
			          
				   }else
				   {
					   System.out.print(next);
				   }
	}
	System.out.println("]");*/
	
	HashSet hash2 = new HashSet();
	hash2.addAll(List1);
	hash2.retainAll(List2);
	
	
	
	HashSet hash3 = new HashSet();
	hash3.addAll(hash1);
	hash3.removeAll(hash2);
	
	
	HashMap hm1 = new HashMap();
	hm1.put("Greg", 27);
	hm1.put("Craig", 40); 
	hm1.put("David", 42);
	hm1.put("Behvean",45);
	hm1.put("Scott", 50);
	
	
	
	HashMap hm2 = new HashMap();
	hm2.put("Kim",40);
	hm2.put("Ben",32);
	hm2.put("Tim", 50);
	hm2.put("Scott", 33);
	hm2.put("Gary", 70);
	
	HashMap hm3 = new HashMap();
	hm3.put("Scott", 19 );
	
	HashMap hm4 = new HashMap();
	hm4.putAll(hm1);
	hm4.putAll(hm2);
	//System.out.print(hm4);
	//hm1.putAll(hm2);
	HashMap hm5 = new HashMap();
	hm5.putAll(hm1);
	
	Iterator itkey = hm2.keySet().iterator();
	while( itkey.hasNext()){
		
		
		String key = (String) itkey.next();
		if(hm2.containsKey(key)){
			hm5.put(key+"1", hm2.get(key));
			
		}
		else {
			hm5.put(key, hm2.get(key));
		}
	}
	HashMap<String, Integer> hm47 = new HashMap<String, Integer>();
	HashMap hm36 = new HashMap<String, Integer>();
	hm47.put("Greg", 22);
	//hm99.put("Greg", 22);
	hm36.put("Greg", 22);
	
	HashMap<String, Integer> hm99 = new HashMap();
	hm99.put("Greg", 22);
	
	
	
//	Iterator itr = hm4.keySet().iterator();
//	System.out.print("[");
//	while(itr.hasNext()){
//		 String next = (String) itr.next();
//		
//		// String next = (String) it.next();
//		   if(it.hasNext())
//				   {
//			          System.out.print(next + ", ");
//			          
//				   }else
//				   {
//					   System.out.print(next);
//				   }
//		 
//		 
//		// System.out.print(next);
//	}
//	System.out.println("]");
//	}
	
}
}
	
